package avatarFrame;

import java.awt.*;

import javax.swing.*;

import person.PersonRecorder;

import constants.Constants;

public class AvatarFrame extends JFrame {
	private AvatarPanel avartaPanel;
	private AvatarInfoPanel avatarInfoPanel;

	public AvatarFrame() {
		this.setLayout(null);
		this.setSize(Constants.AVATAR_FRAME_WIDTH, Constants.AVATAR_FRAME_HEIGHT);
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);

		// avatar panel
		avartaPanel = new AvatarPanel();
		avartaPanel.setLocation(0, 0);
		this.add(avartaPanel);

		// avatar info panel
		avatarInfoPanel = new AvatarInfoPanel();
		avatarInfoPanel.setLocation(500, 0);
		this.add(avatarInfoPanel);

		this.setVisible(false);
	}

	public AvatarInfoPanel getAvatarInfoPanel() {
		return avatarInfoPanel;
	}

	public void setAvatarInfoPanel(AvatarInfoPanel avatarInfoPanel) {
		this.avatarInfoPanel = avatarInfoPanel;
	}

	public void drawAvarta(Image avartaImg) {
		this.setVisible(true);
		avartaPanel.draw(avartaImg);
	}

	public void setPersonRecorder(PersonRecorder personRecorder) {
		avatarInfoPanel.setPersonRecorder(personRecorder);
	}

}
